cmake_minimum_required(VERSION 3.15)
project(DevOpsPlatform)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Create a simple executable for testing
add_executable(devops-platform
    src/main.cpp
    src/auth/OAuth2Server.cpp
)

# For now, just create a simple main if files don't exist
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
    file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp"
        "#include <iostream>\nint main() { std::cout << \\\"DevOps Platform Running!\\\" << std::endl; return 0; }\n"
    )
endif()

if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/auth/OAuth2Server.cpp")
    file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/src/auth/OAuth2Server.cpp"
        "// OAuth2 Server implementation\n"
    )
endif()
